//
//  CAReturnGoodsStatusView.m
//  LNH
//
//  Created by twentylx on 2018/2/26.
//  Copyright © 2018年 twentylx. All rights reserved.
//

#import "CAReturnGoodsDetailStatusView.h"

@implementation CAReturnGoodsDetailStatusView

/**
 为视图绑定 viewModel
 
 @param viewModel 要绑定的ViewModel
 @param params 额外参数
 */
- (void)bindViewModel:(id <LMViewProtocol>)viewModel withParams:(NSDictionary *)params {
    
}

/**
 初始化额外数据
 */
- (void)lm_initializeForView {
}

/**
 初始化视图
 */
- (void)lm_createViewForView {
    [self setNeedsUpdateConstraints];
    
    [self addSubview:self.topLineView];
    [self addSubview:self.returnReason];
    [self addSubview:self.returnPrice];
    [self addSubview:self.returnDate];
    [self addSubview:self.returnNo];
}

#pragma mark layout
- (void)updateConstraints {
    [super updateConstraints];
    
    [_topLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.equalTo(self);
        make.top.equalTo(self);
        make.height.mas_equalTo(ONE_PIXEL);
    }];
    
    [self.returnReason mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.top.equalTo(self).offset(20);
    }];
    
    [self.returnPrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.top.equalTo(self.returnReason.mas_bottom).offset(10);
    }];
    
    [self.returnDate mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.top.equalTo(self.returnPrice.mas_bottom).offset(10);
    }];
    
    [self.returnNo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.top.equalTo(self.returnDate.mas_bottom).offset(10);
    }];
}

#pragma mark get & set
- (UIView *)topLineView {
    if (!_topLineView) {
        _topLineView = [UIView new];
        _topLineView.backgroundColor = RGBCOLOR(186, 186, 186);
    }
    return _topLineView;
}

- (UILabel *)returnReason {
    if (!_returnReason) {
        _returnReason = [UILabel new];
        _returnReason.text = @"退款原因：";
        _returnReason.font = [UIFont systemFontOfSize:14];
    }
    return _returnReason;
}

- (UILabel *)returnPrice {
    if (!_returnPrice) {
        _returnPrice = [UILabel new];
        _returnPrice.text = @"退款金额：";
        _returnPrice.font = [UIFont systemFontOfSize:14];
    }
    return _returnPrice;
}

- (UILabel *)returnDate {
    if (!_returnDate) {
        _returnDate = [UILabel new];
        _returnDate.text = @"申请时间：";
        _returnDate.font = [UIFont systemFontOfSize:14];
    }
    return _returnDate;
}


- (UILabel *)returnNo {
    if (!_returnNo) {
        _returnNo = [UILabel new];
        _returnNo.text = @"退款编号：";
        _returnNo.font = [UIFont systemFontOfSize:14];
    }
    return _returnNo;
}

@end

